<?php
/**
 * @version		$Id: index.php 11407 2009-01-09 17:23:42Z willebil $
 * @package		Joomla
 * @copyright	Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'choisim';

$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(!$conn) {
    die("DB connection failed: " . mysql_error());
}
mysql_select_db($dbname, $conn);
$query = "select * from jos_sim";
$result = mysql_query($query);
$i=0;
while($row = mysql_fetch_array($result)) {
    $i++;
    $sim_numb_absolute = str_replace('.', '', $row['sim_numb']);
    $sim_numb_absolute = str_replace(' ', '', $sim_numb_absolute);
    $sim_numb_absolute = str_replace(' ', '', $sim_numb_absolute);
    $id = $row['sim_id'];
    if($sim_numb_absolute){
        echo $i.'=='.$id.'<br>';
        $query = "update jos_sim set sim_numb_absolute = '$sim_numb_absolute' where sim_id = $id";
        mysql_query($query);
    }
}
mysql_close($conn);
?>